<?php 
/**
 * Agenda View Loop
 * This file sets up the structure for the agenda loop
 */

if ( !defined('ABSPATH') ) { die('-1'); } ?>

<?php 

global $more, $wp_query;
$more = false;
$current_timeslot = null;

?>

<?php

global $post;
$current_date = date('j M Y', mktime(0, 0, 0, 8, 25, 2014));
echo 'current date: ';
echo $current_date;
$end_date = date('j M Y', mktime(23, 59, 59, 9, 1, 2014));
echo '<br><br>end date: ';
echo $end_date;
echo '<br><br><br>';

$get_posts = tribe_get_events(array('start_date'=>$current_date,'end_date'=>$end_date, 'eventDisplay'=>'all', 'posts_per_page'=>-1) );

/*somethings still not right*/

foreach($get_posts as $post) { setup_postdata($post); ?>

	<div class="post">
        <h4 class="post-header"><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a></h4>
        <span class="event-date"><a href="<?php the_permalink(); ?>"><?php echo tribe_get_start_date($post->ID, true, 'M j, Y'); ?></a></span>
        <div class="post-content"><?php the_content(); ?></div>
    </div>

<?php } //endforeach ?>
<?php wp_reset_query(); ?>
